package com.mlz.mlzmall.ui.activity.act.personal.userLogin;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;

import com.mlz.mlzmall.R;
import com.mlz.mlzmall.bean.UserBean;
import com.mlz.mlzmall.ui.activity.act.base.TopTitleView;
import com.mlz.mlzmall.ui.activity.act.main.MainActivity;
import com.mlz.mlzmall.ui.activity.act.personal.NetworkRequest.VolleyBaseActivity;

/**
 * @description 注册成功界面
 * Created by 安帅 on 2016/5/24 11:48.
 */
public class RegistThreeActivity extends VolleyBaseActivity implements View.OnClickListener {
    private UserBean userBean;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.registered_successed);
        userBean = new UserBean();
        assignViews();
        setViewContent();
        setViewClickLinstener();
    }

    private TopTitleView registTopTitleSucceed;
    private TextView tvNumber;
    private Button tvShoppingnow;
    private Button tvCenter;

    private void assignViews() {
        registTopTitleSucceed = (TopTitleView) findViewById(R.id.regist_top_title_succeed);
        tvNumber = (TextView) findViewById(R.id.tv_number);
        tvShoppingnow = (Button) findViewById(R.id.tv_shoppingnow);
        tvCenter = (Button) findViewById(R.id.tv_center);
    }

    private void setViewContent() {
        registTopTitleSucceed.setTitleButtonContent("注册成功", null, null);
        tvNumber.setText(getIntent().getStringExtra("loginName"));
    }

    private void setViewClickLinstener() {
        tvShoppingnow.setOnClickListener(this);
        tvCenter.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent intent=new Intent();
        switch (v.getId()) {
            case R.id.tv_shoppingnow:
                overridePendingTransition(R.anim.right_in, R.anim.left_out);
                intent.setClass(RegistThreeActivity.this, MainActivity.class);
                enterActivityWithFinish(intent);
                break;
            case R.id.tv_center:
                overridePendingTransition(R.anim.right_in, R.anim.left_out);
                intent.setClass(RegistThreeActivity.this, MainActivity.class);
                enterActivityWithFinish(intent);
                break;
        }
    }
}
